﻿<Window x:Class="OxyPlotChartingDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:OxyPlotChartingDemo"
        xmlns:oxy="clr-namespace:OxyPlot.Wpf;assembly=OxyPlot.Wpf" 
        Title="Oxyplot line series demo" Height="350" Width="525">
    <Window.DataContext>
        <local:MainViewModel x:Name="MainViewModel"/>
    </Window.DataContext>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="9*"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>
        <oxy:Plot Title="LineSeries" x:Name="lineSeriesPlot">
            <oxy:Plot.Axes>
                <oxy:DateTimeAxis Title="Days" Name="datetimeAxis" Position="Bottom" StringFormat="d/MMM/yy" IntervalType="Days"
                                  Minimum="{Binding MinimumInterval,Mode=OneWay}" Maximum="{Binding MaximumInterval,Mode=OneWay}" />
                <oxy:TimeSpanAxis Title="Time Elapsed" Name="timeSpanAxis" Position="Left" StringFormat="h:mm" IsZoomEnabled="False"/>
            </oxy:Plot.Axes>
            <oxy:LineSeries Title="Failure" ItemsSource="{Binding FailurePoints,Mode=OneWay}" Smooth="True" Color="Red" MarkerType="Circle" MarkerSize="5" 
                            ToolTip="Backup {0} - Date: {2:d/MMM/yy} ElapsedTime: {4:%d} Days {4:%h} Hours {4:%m} Minutes"
                            MarkerFill="Red"  TrackerFormatString="Backup {0} - Date: {2:d/MMM/yy} ElapsedTime: {4:%d} Days {4:%h} Hours {4:%m} Minutes" LineLegendPosition="End"/>
            <oxy:LineSeries Title="Success" ItemsSource="{Binding SuccessPoints,Mode=OneWay}" Smooth="True" Color="Green" MarkerType="Circle" MarkerSize="5"
                            ToolTip="Backup {0} - Date: {2:d/MMM/yy} ElapsedTime: {4:%d} Days {4:%h} Hours {4:%m} Minutes"
                                MarkerFill="Green"  TrackerFormatString="Backup {0} - Date: {2:d/MMM/yy} ElapsedTime: {4:%d} Days {4:%h} Hours {4:%m} Minutes" LineLegendPosition="End"/>
        </oxy:Plot>
        <Button Content="ChangePoints" Click="Button_Click" Grid.Row="1" Height="30" Width="200" HorizontalContentAlignment="Center"/>
    </Grid>
</Window>